USE dryad;

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for t_sys_dept
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_dept`;
CREATE TABLE `t_sys_dept` (
  `dept_id` int(11) unsigned  NOT NULL AUTO_INCREMENT,
  `name` varchar(64) DEFAULT NULL COMMENT '部门名称',
  `sort` int(11) unsigned  DEFAULT '1' COMMENT '排序',
  `created_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_time` datetime default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `del_flag` char(1) DEFAULT '0' COMMENT '1:已删除 0:未删除',
  `parent_id` int(11) unsigned DEFAULT NULL,
  `reversion`            bigint(20) unsigned default 0,
  `rsv1`                 varchar(128),
  -- TODO
  -- UNIQUE KEY `idx_sys_dept_nm` (`name`) USING BTREE,
  PRIMARY KEY (`dept_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='部门管理';


BEGIN;
INSERT INTO `t_sys_dept` VALUES (1, '城镇中心', 1, '2020-01-22 19:00:23', '2020-05-18 14:56:06', '0', 0,0,null);
INSERT INTO `t_sys_dept` VALUES (2, '国王祭坛', 2, '2020-01-22 19:00:38', '2020-05-18 14:12:07', '0', 1,0,null);
INSERT INTO `t_sys_dept` VALUES (3, '兵营', 3, '2020-01-22 19:00:44', '2020-05-18 14:56:11', '0', 1,0,null);
INSERT INTO `t_sys_dept` VALUES (4, '步兵', 4, '2020-01-22 19:00:52', '2020-05-18 14:56:09', '0', 3,0,null);
INSERT INTO `t_sys_dept` VALUES (5, '顶盾', 5, '2020-01-22 19:00:57', '2020-05-18 14:56:13', '0', 4,0,null);
INSERT INTO `t_sys_dept` VALUES (6, '火枪手', 6, '2020-01-22 19:01:06', '2020-05-18 14:56:16', '0', 3,0,null);
INSERT INTO `t_sys_dept` VALUES (7, '大法师', 7, '2020-01-22 19:01:57', '2020-05-18 14:12:17', '0', 2,0,null);
INSERT INTO `t_sys_dept` VALUES (8, '暴风雪', 8, '2020-01-22 19:02:03', '2020-05-18 14:12:19', '0', 7,0,null);
COMMIT;

-- ----------------------------
-- Table structure for t_sys_dept_relation
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_dept_relation`;
CREATE TABLE `t_sys_dept_relation` (
  `ancestor` int(11) unsigned NOT NULL COMMENT '祖先节点',
  `descendant` int(11) unsigned NOT NULL COMMENT '后代节点',
  `reversion`            bigint(20) unsigned default 0,
  `rsv1`                 varchar(128),
  KEY `idx_dept_rel_descendant` (`descendant`) USING BTREE,
  PRIMARY KEY (`ancestor`,`descendant`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='部门关系表';

BEGIN;
INSERT INTO `t_sys_dept_relation` VALUES (1, 1,0,null);
INSERT INTO `t_sys_dept_relation` VALUES (1, 2,0,null);
INSERT INTO `t_sys_dept_relation` VALUES (1, 3,0,null);
INSERT INTO `t_sys_dept_relation` VALUES (1, 4,0,null);
INSERT INTO `t_sys_dept_relation` VALUES (1, 5,0,null);
INSERT INTO `t_sys_dept_relation` VALUES (1, 6,0,null);
INSERT INTO `t_sys_dept_relation` VALUES (1, 7,0,null);
INSERT INTO `t_sys_dept_relation` VALUES (1, 8,0,null);

INSERT INTO `t_sys_dept_relation` VALUES (2, 2,0,null);
INSERT INTO `t_sys_dept_relation` VALUES (2, 7,0,null);
INSERT INTO `t_sys_dept_relation` VALUES (2, 8,0,null);


INSERT INTO `t_sys_dept_relation` VALUES (3, 3,0,null);
INSERT INTO `t_sys_dept_relation` VALUES (3, 4,0,null);
INSERT INTO `t_sys_dept_relation` VALUES (3, 5,0,null);
INSERT INTO `t_sys_dept_relation` VALUES (3, 6,0,null);

INSERT INTO `t_sys_dept_relation` VALUES (4, 4,0,null);
INSERT INTO `t_sys_dept_relation` VALUES (4, 5,0,null);

INSERT INTO `t_sys_dept_relation` VALUES (5, 5,0,null);

INSERT INTO `t_sys_dept_relation` VALUES (7, 7,0,null);
INSERT INTO `t_sys_dept_relation` VALUES (7, 8,0,null);


INSERT INTO `t_sys_dept_relation` VALUES (8, 8,0,null);
COMMIT;



-- ----------------------------
-- Table structure for t_sys_file
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_file`;
CREATE TABLE `t_sys_file` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
  `file_name` varchar(128) DEFAULT NULL COMMENT '文件名',
  `file_dir`  varchar(255) DEFAULT NULL COMMENT '文件路径',
  `bucket_name` varchar(128) DEFAULT NULL COMMENT '容器名称',
  `original` varchar(128) DEFAULT NULL COMMENT '原文件名',
  `type` varchar(8) DEFAULT NULL COMMENT '文件后缀',
  `file_size` bigint(20) DEFAULT NULL COMMENT '文件大小',
  `custom_domain` varchar(128) DEFAULT NULL COMMENT '自定义域名',
  `created_by` varchar(64) DEFAULT NULL,
  `created_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '上传时间',
  `updated_by` varchar(64) DEFAULT NULL,
  `updated_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `del_flag` char(1) DEFAULT '0' COMMENT '1:已删除 0:未删除',
  `reversion`            bigint(20) unsigned default 0,
  `rsv1`                 varchar(128),
   KEY `idx_sys_file_fn` (`file_name`) USING BTREE,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='文件管理表';



-- ----------------------------
-- Table structure for t_sys_menu
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_menu`;
CREATE TABLE `t_sys_menu` (
  `menu_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '菜单ID',
  `name` varchar(32) DEFAULT NULL COMMENT '菜单名称',
  `permission` varchar(32) DEFAULT NULL COMMENT '单权限标识',
  `path` varchar(128) DEFAULT NULL COMMENT '前端路由标识路径',
  `parent_id` int(11)  DEFAULT NULL COMMENT '父菜单ID(根节点为-1)',
  `icon` varchar(64) DEFAULT NULL COMMENT '图标',
  `sort` int(11) unsigned DEFAULT '1' COMMENT '排序值',
  `keep_alive` char(1) DEFAULT '0'  COMMENT '路由缓冲',
  `type` char(1) DEFAULT '0' COMMENT '0:菜单 1:按钮 ',
  `created_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_time` datetime default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `del_flag` char(1) DEFAULT '0' COMMENT '1:已删除 0:未删除',
  `reversion`            bigint(20) unsigned default 0,
  `rsv1`                 varchar(128),
  -- TODO
  UNIQUE KEY `idx_sys_menu_path` (`path`) USING BTREE,
  PRIMARY KEY (`menu_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=10040 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='菜单权限表';


BEGIN;
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (1000,'权限管理',NULL,'/user',-1,'icon-quanxianguanli',0,'0','0','2019-09-28 08:29:53','2020-03-24 08:56:32','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (1100,'用户管理',NULL,'/admin/user/index',1000,'icon-yonghuguanli',1,'0','0','2020-11-02 22:24:37','2020-03-24 08:56:33','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (1101,'用户新增','sys_user_add',NULL,1100,NULL,3,'0','1','2019-11-08 09:52:09','2020-03-24 08:56:34','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (1102,'用户修改','sys_user_edit',NULL,1100,NULL,2,'0','1','2019-11-08 09:52:48','2020-03-24 08:56:35','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (1103,'用户删除','sys_user_del',NULL,1100,NULL,1,'0','1','2019-11-08 09:54:01','2020-03-24 08:56:37','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (1200,'菜单管理',NULL,'/admin/menu/index',1000,'icon-caidanguanli',2,'0','0','2019-11-08 09:57:27','2020-03-24 08:56:38','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (1201,'菜单新增','sys_menu_add',NULL,1200,NULL,1,'0','1','2019-11-08 10:15:53','2020-03-24 08:56:39','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (1202,'菜单修改','sys_menu_edit',NULL,1200,NULL,2,'0','1','2019-11-08 10:16:23','2020-03-24 08:56:40','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (1203,'菜单删除','sys_menu_del',NULL,1200,NULL,3,'0','1','2019-11-08 10:16:43','2020-03-24 08:56:41','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (1300,'角色管理',NULL,'/admin/role/index',1000,'icon-jiaoseguanli',3,'0','0','2019-11-08 10:13:37','2020-03-24 08:56:42','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (1301,'角色新增','sys_role_add',NULL,1300,NULL,1,'0','1','2019-11-08 10:14:18','2020-03-24 08:56:43','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (1302,'角色修改','sys_role_edit',NULL,1300,NULL,2,'0','1','2019-11-08 10:14:41','2020-03-24 08:56:43','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (1303,'角色删除','sys_role_del',NULL,1300,NULL,3,'0','1','2019-11-08 10:14:59','2020-03-24 08:56:45','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (1304,'分配权限','sys_role_perm',NULL,1300,NULL,4,'0','1','2020-01-20 07:22:55','2020-03-24 08:56:46','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (1400,'部门管理',NULL,'/admin/dept/index',1000,'icon-bumenguanli',4,'0','0','2020-01-20 13:17:19','2020-03-24 08:56:47','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (1401,'部门新增','sys_dept_add',NULL,1400,NULL,1,'0','1','2020-01-20 14:56:16','2020-03-24 08:56:48','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (1402,'部门修改','sys_dept_edit',NULL,1400,NULL,2,'0','1','2020-01-20 14:56:59','2020-03-24 08:56:48','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (1403,'部门删除','sys_dept_del',NULL,1400,NULL,3,'0','1','2020-01-20 14:57:28','2020-03-24 08:56:51','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (1500,'租户管理','','/admin/tenant/index',1000,'icon-erji-zuhushouye',5,'0','0','2018-01-20 13:17:19','2020-03-24 08:56:49','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (1501,'租户新增','admin_systenant_add',NULL,1500,NULL,1,'0','1','2018-05-15 21:35:18','2020-03-24 08:56:52','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (1502,'租户修改','admin_systenant_edit',NULL,1500,NULL,2,'0','1','2018-05-15 21:35:18','2020-03-24 08:56:53','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (1503,'租户删除','admin_systenant_del',NULL,1500,NULL,3,'0','1','2018-05-15 21:35:18','2020-03-24 08:56:54','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (2000,'系统管理',NULL,'/sys',-1,'icon-xitongguanli',1,'0','0','2019-11-07 20:56:00','2020-03-24 08:56:55','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (2200,'字典管理',NULL,'/admin/dict/index',2000,'icon-navicon-zdgl',6,'0','0','2019-11-29 11:30:52','2020-03-24 08:56:58','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (2201,'字典删除','sys_dict_del',NULL,2200,NULL,1,'0','1','2019-11-29 11:30:11','2020-03-24 08:56:59','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (2202,'字典新增','sys_dict_add',NULL,2200,NULL,2,'0','1','2020-01-11 22:34:55','2020-03-24 08:57:01','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (2203,'字典修改','sys_dict_edit',NULL,2200,NULL,3,'0','1','2020-01-11 22:36:03','2020-03-24 08:57:09','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (2210,'参数管理',NULL,'/admin/param/index',2000,'icon-canshuzhihang',7,'1','0','2020-02-29 22:16:50','2020-03-24 08:57:10','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (2211,'参数新增','admin_syspublicparam_add',NULL,2210,NULL,1,'0','1','2020-02-29 22:17:36','2020-03-24 08:57:11','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (2212,'参数删除','admin_syspublicparam_del',NULL,2210,NULL,2,'0','1','2020-02-29 22:17:55','2020-03-24 08:57:12','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (2213,'参数编辑','admin_syspublicparam_edit',NULL,2210,NULL,3,'0','1','2020-02-29 22:18:14','2020-03-24 08:57:13','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (2300,'代码生成','','/gen/index',10006,'icon-kaifafuzhu',1,'0','0','2020-01-20 13:17:19','2020-03-24 08:57:14','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (3000,'系统监控',NULL,'/monitor',-1,'icon-erji-jiankongtubiao',2,'0','0','2020-02-27 01:13:21','2020-03-24 08:57:31','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (3100,'服务监控',NULL,'/monitor/oserver/index',3000,'icon-fuwuqi',1,'0','0','2020-02-26 10:50:32','2021-01-08 16:28:39','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (3110,'缓存监控',NULL,'/monitor/redis/index',3000,'icon-redis',2,'0','0','2020-02-08 23:51:27','2020-03-24 08:57:33','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (3120,'数据监控',NULL,'/monitor/sql/index',3000,'icon-sqlMonitor',3,'0','0','2020-02-26 10:50:32','2021-01-08 16:37:09','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (3200,'接口文档',NULL,'http://127.0.0.1:19084/doc.html',3000,'icon-pingtaiapicanshu',4,'0','0','2020-06-26 10:50:32','2020-03-24 08:57:34','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10000,'文件管理',NULL,'/admin/file/index',2000,'icon-wenjianguanli',6,'0','0','2020-06-25 12:44:46','2020-03-24 08:58:41','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10011,'添加文件','sys_file_add',NULL,10000,NULL,1,'0','1','2020-02-25 13:41:41','2020-03-24 08:58:42','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10001,'删除文件','sys_file_del',NULL,10000,NULL,2,'0','1','2020-02-25 13:41:41','2020-03-24 08:58:42','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10002,'表单管理','','/gen/form',10006,'icon-record',3,'0','0','2020-02-20 13:17:19','2020-03-24 08:58:44','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10003,'表单新增','gen_form_add',NULL,10002,NULL,1,'0','1','2020-02-15 21:35:18','2020-03-24 08:58:45','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10004,'表单修改','gen_form_edit',NULL,10002,NULL,2,'0','1','2020-02-15 21:35:18','2020-03-24 08:58:46','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10005,'表单删除','gen_form_del',NULL,10002,NULL,3,'0','1','2020-02-15 21:35:18','2020-03-24 08:58:47','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10006,'系统工具',NULL,'/gen',-1,'icon-gongju',9,'0','0','2020-02-12 09:35:16','2020-03-24 08:58:48','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10008,'表单设计',NULL,'/gen/design',10006,'icon-biaodanbiaoqian',2,'0','0','2020-02-16 10:08:56','2020-03-24 08:58:53','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10016,'协同管理',NULL,'/activiti',-1,'icon-workflow',6,'0','0','2020-11-30 11:57:11','2021-01-08 16:37:38','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10017,'流程管理',NULL,'/activiti/definition/index',10016,'icon-liucheng',1,'0','0','2020-11-30 11:57:11','2021-01-04 12:10:00','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10018,'请假管理',NULL,'/activiti/workflow/leave/index',10016,'icon-qingjia',2,'0','0','2020-12-01 17:23:25','2021-01-04 12:11:21','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10019,'请假新增','workflow_leave_add',NULL,10018,NULL,1,'0','1','2020-12-01 17:25:43','2021-01-04 12:11:21','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10020,'请假修改','workflow_leave_edit',NULL,10018,NULL,2,'0','1','2020-12-01 17:26:22','2021-01-04 12:11:21','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10021,'请假删除','workflow_leave_del',NULL,10018,NULL,3,'0','1','2020-12-01 17:26:55','2021-01-04 12:11:21','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10022,'请假导出','workflow_leave_export',NULL,10018,NULL,4,'0','1','2020-12-01 17:26:55','2021-01-04 12:11:21','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10023,'待办任务',NULL,'/activiti/task/index',10016,'icon-daiban',3,'0','0','2020-12-09 17:03:26','2021-01-04 12:11:21','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10024,'请假审批','workflow_leave_edit',NULL,10023,NULL,1,'0','1','2020-12-09 17:06:10','2021-01-04 12:11:21','0',0,NULL);

-- INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10031,'TOTP获取','admin_totp_get',NULL,1100,NULL,100,'0','1','2019-11-08 09:52:09','2020-03-24 08:56:34','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10032,'消息测试', NULL, '/gen/socket/index', 10006, 'icon-ceshiliucheng', 999, '0', '0', '2021-01-20 11:30:02', NULL, '0', 0, NULL);

INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10007,'数据源管理',NULL,'/gen/datasource',10006,'icon-mysql',0,'0','0','2020-02-12 09:42:11','2020-03-24 08:58:49','0',0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10033,'令牌管理', NULL, '/admin/token/index', 2000, 'icon-denglvlingpai', 11, '0', '0', '2018-09-04 05:58:41', '2020-03-24 08:57:24', '0', 0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10034,'令牌删除', 'sys_token_del', NULL, 10033, NULL, 1, '0', '1', '2018-09-04 05:59:50', '2020-03-24 08:57:24', '0', 0,NULL);

INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10035,'日志管理', NULL, '/admin/log/index', 2000, 'icon-rizhiguanli', 5, '0', '0', '2017-11-20 14:06:22', '2020-03-24 08:56:56', '0', 0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10036,'日志删除', 'sys_log_del', NULL, 10035, NULL, 1, '0', '1', '2020-07-29 13:38:19', '2020-03-24 08:56:58', '0', 0,NULL);

INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10037,'岗位管理', NULL, '/admin/post/index', 1000, 'icon-gangweiquanxian', 5, '0', '0', '2020-07-29 13:38:19', '2020-07-29 13:38:19', '0', 0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10038,'岗位新增', 'admin_syspost_add', NULL, 10037, NULL, 1, '0', '1', '2020-07-29 13:38:19', '2020-03-24 08:56:58', '0', 0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10039,'岗位修改', 'admin_syspost_edit', NULL, 10037, NULL, 2, '0', '1', '2020-07-29 13:38:19', '2020-03-24 08:56:58', '0', 0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10040,'岗位删除', 'admin_syspost_del', NULL, 10037, NULL, 3, '0', '1', '2020-07-29 13:38:19', '2020-03-24 08:56:58', '0', 0,NULL);

INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10041,'通知公告', NULL, '/admin/notice/index', 2000, 'icon-ai-message', 12, '0', '0', '2021-01-20 11:30:02', NULL, '0', 0, NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10042,'通知公告新增', 'admin_sysnotice_add', NULL, 10041, NULL, 1, '0', '1', '2020-07-29 13:38:19', '2020-03-24 08:56:58', '0', 0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10043,'通知公告修改', 'admin_sysnotice_edit', NULL, 10041, NULL, 2, '0', '1', '2020-07-29 13:38:19', '2020-03-24 08:56:58', '0', 0,NULL);
INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (10044,'通知公告删除', 'admin_sysnotice_del', NULL, 10041, NULL, 3, '0', '1', '2020-07-29 13:38:19', '2020-03-24 08:56:58', '0', 0,NULL);

INSERT INTO `t_sys_menu` (`menu_id`,`name`,`permission`,`path`,`parent_id`,`icon`,`sort`,`keep_alive`,`type`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (20000,'项目官网',NULL,'https://gitee.com/jiangpingcmt1/dryad',-1,'icon-diqiu',999,'0','0','2020-06-26 10:50:32','2020-03-24 08:57:34','0',0,NULL);



-- ----------------------------
-- Table structure for t_sys_role
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_role`;
CREATE TABLE `t_sys_role` (
  `role_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `role_name` varchar(64) DEFAULT NULL COMMENT '角色名',
  `role_code` varchar(64) DEFAULT NULL COMMENT '角色编码',
  `role_desc` varchar(255) DEFAULT NULL COMMENT '角色描述',
  `ds_type` char(1) DEFAULT '2' COMMENT '0-全部 1-自定义 2-本级及子级 3-本级' ,
  `ds_scope` varchar(255) DEFAULT NULL COMMENT '数据权限作用范围',
  `created_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_time` datetime default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `del_flag` char(1) DEFAULT '0' COMMENT '1:已删除 0:未删除',
  `reversion`            bigint(20) unsigned default 0,
  `rsv1`                 varchar(128),
    -- TODO
    -- UNIQUE KEY `idx_sys_role_rn` (`role_name`) USING BTREE,
    -- TODO
    -- UNIQUE KEY `idx_sys_role_rc` (`role_code`) USING BTREE,
  PRIMARY KEY (`role_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='系统角色表';


BEGIN;
INSERT INTO `t_sys_role` VALUES (1, '管理员', 'ROLE_ADMIN', '管理员', '0', '1', '2019-10-29 15:45:51', '2020-12-26 14:09:11', '0',0,null);
INSERT INTO `t_sys_role` (`role_id`,`role_name`,`role_code`,`role_desc`,`ds_type`,`ds_scope`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (2,'普通用户','ROLE_USER','普通用户','3','3','2020-12-02 16:11:50','2020-12-03 19:09:51','0',0,NULL);
INSERT INTO `t_sys_role` (`role_id`,`role_name`,`role_code`,`role_desc`,`ds_type`,`ds_scope`,`created_time`,`updated_time`,`del_flag`,`reversion`,`rsv1`) VALUES (3,'高级用户','ROLE_SUPER','高级用户','2','3','2020-12-10 16:57:47','2020-12-03 19:09:51','0',0,NULL);
COMMIT;

-- ----------------------------
-- Table structure for t_sys_role_menu
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_role_menu`;
CREATE TABLE `t_sys_role_menu` (
  `role_id` int(11) unsigned NOT NULL COMMENT '角色ID',
  `menu_id` int(11) unsigned NOT NULL COMMENT '菜单ID',
  `reversion`            bigint(20) unsigned default 0,
  `rsv1`                 varchar(128),
  KEY `idx_sys_role_menu_id` (`menu_id`) USING BTREE,
  PRIMARY KEY (`role_id`,`menu_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='角色菜单表';


BEGIN;
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,1000,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,1100,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,1101,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,1102,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,1103,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,1200,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,1201,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,1202,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,1203,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,1300,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,1301,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,1302,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,1303,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,1304,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,1400,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,1401,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,1402,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,1403,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,1500,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,1501,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,1502,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,1503,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,2000,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,2200,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,2201,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,2202,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,2203,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,2210,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,2211,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,2212,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,2213,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,2300,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,3000,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,3100,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,3110,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,3120,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,3200,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10000,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10011,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10001,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10002,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10003,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10004,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10005,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10006,0,NULL);

INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10008,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10016,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10017,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10018,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10019,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10020,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10021,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10022,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10023,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10024,0,NULL);
-- INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10031,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10032,0,NULL);

INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10007,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10033,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10034,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10035,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10036,0,NULL);

INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10037,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10038,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10039,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10040,0,NULL);

INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10041,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10042,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10043,0,NULL);
INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,10044,0,NULL);

INSERT INTO `t_sys_role_menu` (`role_id`,`menu_id`,`reversion`,`rsv1`) VALUES (1,20000,0,NULL);

COMMIT;


-- ----------------------------
-- Table structure for t_sys_user
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_user`;
CREATE TABLE `t_sys_user` (
  `user_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `username` varchar(64) DEFAULT NULL COMMENT '用户名',
  `password` varchar(255) DEFAULT NULL COMMENT '密码',
  `salt` varchar(255) DEFAULT NULL COMMENT '随机盐',
  `phone` varchar(20) DEFAULT NULL COMMENT '手机号',
  `avatar` mediumblob COMMENT '头像',
  `root_flag`   char(1)   NOT NULL DEFAULT '1' COMMENT '根用户标识（0:root根用户[超级管理员] 1:自定义角色用户）',
  `dept_id` int(11) unsigned DEFAULT NULL COMMENT '部门ID',
  `created_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `lock_flag` char(1) DEFAULT '0' COMMENT '锁定标记(锁定标记 1:锁定 0:未锁定)',
  `del_flag` char(1) DEFAULT '0' COMMENT '删除标识(1:已删除 0:未删除)',
  `online_flag` char(1) DEFAULT '1' COMMENT '在线标识(1:离线 0:在线)',
  `wx_openid` varchar(32) DEFAULT NULL COMMENT '微信登录openId',
  `mini_openid` varchar(32) DEFAULT NULL COMMENT '小程序openId',
  `qq_openid` varchar(32) DEFAULT NULL COMMENT 'QQ openId',
  `reversion` bigint(20) unsigned DEFAULT '0',
  `rsv1` varchar(128) DEFAULT NULL ,
  `totp` varchar(32) DEFAULT NULL COMMENT 'TOTP因子',
  `token` varchar(64) DEFAULT NULL COMMENT ' TOEKN值',
  `token_expire_time` datetime DEFAULT NULL COMMENT 'TOEKN过期时间',

  KEY `idx_user_wx_openid` (`wx_openid`) USING BTREE,
  KEY `idx_user_mini_openid` (`mini_openid`) USING BTREE,
  KEY `idx_user_qq_openid` (`qq_openid`) USING BTREE,
  KEY `idx_user_deptid` (`dept_id`) USING BTREE,
  KEY `idx_user_token` (`token`) USING BTREE,
  -- TODO
  -- UNIQUE KEY `idx_user_username` (`username`) USING BTREE,
  KEY `idx_user_username` (`username`) USING BTREE,
  PRIMARY KEY (`user_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='用户表';

-- ----------------------------
-- Records of t_sys_user
-- ----------------------------
BEGIN;
INSERT INTO `t_sys_user` (`user_id`,`username`,`password`,`salt`,`phone`,`avatar`,`root_flag`,`dept_id`,`created_time`,`updated_time`,`lock_flag`,`del_flag`,`wx_openid`,`mini_openid`,`qq_openid`,`reversion`,`rsv1`,`totp`,`token`,`token_expire_time`)
VALUES (999,'root','$2a$10$IVzj1Wd.ZQdOIWdb1htQjexU94uoNeuk1crlQ9ExVupPi0Iy1uv.C','','17034642888','',0,1,'2020-04-20 07:15:18','2020-12-21 15:09:44','0','0',NULL,NULL,NULL,0,NULL,'TW2762JMYJHBU55ETW2762JMYJHBU55E','99d5e998-058e-4a76-9b99-5fd4d525630f','2999-12-31 23:59:59');
INSERT INTO `t_sys_user` (`user_id`,`username`,`password`,`salt`,`phone`,`avatar`,`root_flag`,`dept_id`,`created_time`,`updated_time`,`lock_flag`,`del_flag`,`wx_openid`,`mini_openid`,`qq_openid`,`reversion`,`rsv1`,`totp`,`token`,`token_expire_time`)
VALUES (1,'admin','$2a$10$IVzj1Wd.ZQdOIWdb1htQjexU94uoNeuk1crlQ9ExVupPi0Iy1uv.C','','17034642888','',1,1,'2020-04-20 07:15:18','2020-12-21 15:09:44','0','0',NULL,NULL,NULL,0,NULL,'TW2762JMYJHBU55ETW2762JMYJHBU55E','99d5e998-058e-4a76-9b99-5fd4d525630f','2999-12-31 23:59:59');
INSERT INTO `t_sys_user` (`user_id`,`username`,`password`,`salt`,`phone`,`avatar`,`dept_id`,`created_time`,`updated_time`,`lock_flag`,`del_flag`,`wx_openid`,`mini_openid`,`qq_openid`,`reversion`,`rsv1`,`totp`,`token`,`token_expire_time`) VALUES (2,'lqx','$2a$10$R7zSc1kVmwNz1Vrn5ltJh.hsIQxpWTRGrROlwfEs5Rgi7sxyZeAZ6',NULL,'',NULL,3,'2020-12-10 16:58:35','2021-01-08 17:16:54','0','0',NULL,NULL,NULL,0,NULL,'TW2762JMYJHBU55ETW2762JMYJHBU55E','925d582e-8198-4861-b968-7dc56fdf5852','2020-12-13 21:23:42');
INSERT INTO `t_sys_user` (`user_id`,`username`,`password`,`salt`,`phone`,`avatar`,`dept_id`,`created_time`,`updated_time`,`lock_flag`,`del_flag`,`wx_openid`,`mini_openid`,`qq_openid`,`reversion`,`rsv1`,`totp`,`token`,`token_expire_time`) VALUES (3,'kim','$2a$10$3ptP5kxpgJhOd5.6YCw4veHbTS8gKTVfYiUCIyaiuBTtb/8urxOJa',NULL,'',NULL,4,'2020-12-02 16:17:55','2021-01-08 17:16:54','0','0',NULL,NULL,NULL,0,NULL,'TW2762JMYJHBU55ETW2762JMYJHBU55E','4041fe42-5844-4ccd-baf3-e414010007d5','2020-12-13 21:22:25');
COMMIT;

-- ----------------------------
-- Table structure for t_sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_user_role`;
CREATE TABLE `t_sys_user_role` (
  `user_id` bigint(20) unsigned NOT NULL COMMENT '用户ID',
  `role_id` int(11) unsigned NOT NULL COMMENT '角色ID',
  `reversion`            bigint(20) unsigned default 0,
  `rsv1`                 varchar(128),
  KEY `idx_sys_user_role_ri` (`role_id`) USING BTREE,
  PRIMARY KEY (`user_id`,`role_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='用户角色表';

-- ----------------------------
-- Records of t_sys_user_role
-- ----------------------------
BEGIN;
INSERT INTO `t_sys_user_role` (`user_id`,`role_id`,`reversion`,`rsv1`) VALUES (1,1,0,NULL);
INSERT INTO `t_sys_user_role` (`user_id`,`role_id`,`reversion`,`rsv1`) VALUES (2,3,0,NULL);
INSERT INTO `t_sys_user_role` (`user_id`,`role_id`,`reversion`,`rsv1`) VALUES (3,2,0,NULL);
COMMIT;

DROP TABLE IF EXISTS `t_sys_tenant`;
CREATE TABLE `t_sys_tenant` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '租户id',
  `name` varchar(255) not null COMMENT '租户名称',
  `code` varchar(64) not null COMMENT '租户编号',
  `start_time` datetime DEFAULT NULL COMMENT '开始时间',
  `end_time` datetime DEFAULT NULL COMMENT '结束时间',
  `status` char(1) DEFAULT '0' COMMENT '0-正常 9-锁定',
  `del_flag` char(1) DEFAULT '0' COMMENT '1:已删除 0:未删除',
  `created_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP  COMMENT '创建时间',
  `updated_time` datetime  DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `datasource` varchar(32) not null COMMENT '数据源名称',
  `reversion`            bigint(20) unsigned default 0,
  `rsv1`                 varchar(128),
    -- TODO
    -- UNIQUE KEY `idx_sys_tenant_cd` (`code`) USING BTREE,
    -- TODO
    -- UNIQUE KEY `idx_sys_tenant_nm` (`name`) USING BTREE,
  PRIMARY KEY (`id`) USING BTREE

) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='租户表';
-- ----------------------------
-- Records of t_sys_user_role
-- ----------------------------
BEGIN;
INSERT INTO `t_sys_tenant` (`id`,`name`,`code`,`start_time`,`end_time`,`status`,`del_flag`,`created_time`,`updated_time`,`datasource`) VALUES (1,'人族','DB_0','2019-05-15 00:00:00','2099-05-15 00:00:00','0','0','2019-05-15 15:44:57','2019-05-18 14:47:30','DB_0');
INSERT INTO `t_sys_tenant` (`id`,`name`,`code`,`start_time`,`end_time`,`status`,`del_flag`,`created_time`,`updated_time`,`datasource`) VALUES (2,'兽人','DB_1','2019-05-15 00:00:00','2099-05-15 00:00:00','0','0','2019-05-15 15:44:57','2019-05-18 14:47:30','DB_1');
INSERT INTO `t_sys_tenant` (`id`,`name`,`code`,`start_time`,`end_time`,`status`,`del_flag`,`created_time`,`updated_time`,`datasource`) VALUES (3,'精灵族','DB_2','2019-05-15 00:00:00','2099-05-15 00:00:00','0','1','2019-05-15 15:44:57','2019-05-18 14:47:30','DB_2');
INSERT INTO `t_sys_tenant` (`id`,`name`,`code`,`start_time`,`end_time`,`status`,`del_flag`,`created_time`,`updated_time`,`datasource`) VALUES (4,'不死族','DB_3','2019-05-15 00:00:00','2099-05-15 00:00:00','0','1','2019-05-15 15:44:57','2019-05-18 14:47:30','DB_3');
COMMIT;

-- ----------------------------
-- Table structure for t_sys_public_param
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_public_param`;
CREATE TABLE `t_sys_public_param` (
  `public_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
  `public_name` varchar(128) DEFAULT NULL COMMENT '公共参数名称',
  `public_key` varchar(128) DEFAULT NULL COMMENT '公共参数地址值,英文大写+下划线',
  `public_value` varchar(128) DEFAULT NULL COMMENT '值',
  `status` char(1) DEFAULT '0' COMMENT ' 状态 0-有效；1-无效',
  `validate_code` varchar(64) DEFAULT NULL COMMENT '公共参数编码',
  `created_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_time` datetime default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `public_type` char(1) DEFAULT '0' COMMENT '配置类型：0-默认；1-检索；2-原文；3-报表；4-安全；5-文档；6-消息；9-其他',
  `system` char(1) DEFAULT '0' COMMENT '是否是系统内置',
  `del_flag` char(1) DEFAULT '0' COMMENT '1:已删除 0:未删除',
  `reversion`            bigint(20) unsigned default 0,
  `rsv1`                 varchar(128),
  -- TODO
  -- UNIQUE KEY `idx_sys_public_param_pn` (`public_name`) USING BTREE,
  -- TODO
  -- UNIQUE KEY `idx_sys_public_param_pk` (`public_key`) USING BTREE,
  PRIMARY KEY (`public_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='公共参数配置表';

-- ----------------------------
-- Records of t_sys_public_param
-- ----------------------------
BEGIN;
INSERT INTO `t_sys_public_param` VALUES (1, '租户默认来源', 'TENANT_DEFAULT_ID', '1', '0', '', '2020-05-12 04:03:46', NULL, '2', '1', '0',0,null);
INSERT INTO `t_sys_public_param` VALUES (2, '租户默认部门名称', 'TENANT_DEFAULT_DEPTNAME', '租户默认部门', '0', '', '2020-05-12 03:36:32', NULL, '2', '1', '0',0,null);
INSERT INTO `t_sys_public_param` VALUES (3, '租户默认账户', 'TENANT_DEFAULT_USERNAME', 'admin', '0', '', '2020-05-12 04:05:04', NULL, '2', '1', '0',0,null);
INSERT INTO `t_sys_public_param` VALUES (4, '租户默认密码', 'TENANT_DEFAULT_PASSWORD', '123456', '0', '', '2020-05-12 04:05:24', NULL, '2', '1', '0',0,null);
INSERT INTO `t_sys_public_param` VALUES (5, '租户默认角色编码', 'TENANT_DEFAULT_ROLECODE', 'ROLE_ADMIN', '0', '', '2020-05-12 04:05:57', NULL, '2', '1', '0',0,null);
INSERT INTO `t_sys_public_param` VALUES (6, '租户默认角色名称', 'TENANT_DEFAULT_ROLENAME', '租户默认角色', '0', '', '2020-05-12 04:06:19', NULL, '2', '1', '0',0,null);
INSERT INTO `t_sys_public_param` VALUES (7, '表前缀', 'GEN_TABLE_PREFIX', 't_', '0', '', '2020-05-12 04:23:04', NULL, '9', '1', '0',0,null);
INSERT INTO `t_sys_public_param` VALUES (8, '接口文档不显示的字段', 'GEN_HIDDEN_COLUMNS', 'tenant_id', '0', '', '2020-05-12 04:25:19', NULL, '9', '1', '0',0,null);
COMMIT;


/*==============================================================*/
/* Table: t_dict_type                                           */
/*==============================================================*/
drop table if exists t_dict_type;
create table t_dict_type
(
   id                   bigint(20) unsigned NOT NULL AUTO_INCREMENT,
   dict_type            varchar(16) not null comment '字典类型',
   dict_name            varchar(64) comment '字典名',
   dict_desc            varchar(255) comment '字典描述',
   use_flag             char(1) default 'Y' comment 'Y正常 N停用',
   created_by           varchar(64),
   created_time         datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
   updated_by           varchar(64),
   updated_time         datetime default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
   ori_id               varchar(32),
   reversion            bigint(20) unsigned default 0,
   rsv1                 varchar(128),
   UNIQUE KEY `idx_dict_type_dt` (`dict_type`) USING BTREE,
   UNIQUE KEY `idx_dict_type_dn` (`dict_name`) USING BTREE,
   primary key (id) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='字典类型';


-- ----------------------------
-- Records of t_dict_type
-- ----------------------------
BEGIN;
INSERT INTO `t_dict_type` VALUES (1, 'dict_type', '字典类型', '系统类不能修改', 'Y', NULL, '2019-05-16 14:16:20', NULL, '2019-05-16 14:20:16', NULL, 1, NULL);
INSERT INTO `t_dict_type` VALUES (2, 'status_type', '租户状态', '租户状态字典', 'Y', NULL, '2019-05-16 14:16:20', NULL, '2019-05-16 14:20:16', NULL, 1, NULL);
INSERT INTO `t_dict_type` VALUES (3, 'param_type', '参数类型', '参数类型字典', 'Y', NULL, '2019-05-16 14:16:20', NULL, '2019-05-16 14:20:16', NULL, 1, NULL);
COMMIT;

/*==============================================================*/
/* Table: t_dict_code                                           */
/*==============================================================*/
drop table if exists t_dict_code;
create table t_dict_code
(
   id                   bigint(20) unsigned NOT NULL AUTO_INCREMENT,
   dict_type            varchar(32) not null comment '字典类型',
   priority             smallint DEFAULT '0' comment '优先级',
   dict_label           varchar(128) not null comment '字典标签',
   dict_value           varchar(255) not null comment '字典标签值',
   dict_desc            varchar(255) comment '字典描述',
   main_flag            char(1) default 'N' comment '是否默认（Y是 N否）',
   use_flag             char(1) default 'Y' comment '（Y正常 N停用）',
   created_by           varchar(64),
   created_time         datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
   updated_by           varchar(64),
   updated_time         datetime default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
   ori_id               varchar(32),
   reversion            bigint(20) unsigned default 0,
   rsv1                 varchar(128)  comment '1-系统内置 0-业务类',
   KEY `idx_dict_code_dt` (`dict_type`) USING BTREE,
   UNIQUE KEY `idx_dict_code_dlt` (`dict_label`,`dict_type`) USING BTREE,
   primary key (id) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='字典明细';

-- ----------------------------
-- Records of t_dict_code
-- ----------------------------
BEGIN;
INSERT INTO `t_dict_code` VALUES (1, 'dict_type', 0, '系统类', '1', '系统类字典', NULL, 'Y', NULL, '2019-05-16 14:20:40', NULL, '2019-05-16 14:20:40', NULL, 1, NULL);
INSERT INTO `t_dict_code` VALUES (2, 'dict_type', 0, '业务类', '0', '业务类字典', NULL, 'Y', NULL, '2019-05-16 14:20:40', NULL, '2019-05-16 14:20:40', NULL, 1, NULL);
INSERT INTO `t_dict_code` VALUES (3, 'status_type', 0, '正常', '0', '状态正常', NULL, 'Y', NULL, '2019-05-16 14:20:40', NULL, '2019-05-16 14:20:40', NULL, 1, NULL);
INSERT INTO `t_dict_code` VALUES (4, 'status_type', 1, '冻结', '9', '状态冻结', NULL, 'Y', NULL, '2019-05-16 14:20:40', NULL, '2019-05-16 14:20:40', NULL, 1, NULL);
INSERT INTO `t_dict_code` VALUES (5, 'param_type', 0, '检索', '1', '检索', NULL, 'Y', NULL, '2019-05-16 14:20:40', NULL, '2019-05-16 14:20:40', NULL, 1, NULL);
INSERT INTO `t_dict_code` VALUES (6, 'param_type', 0, '原文', '2', '原文', NULL, 'Y', NULL, '2019-05-16 14:20:40', NULL, '2019-05-16 14:20:40', NULL, 1, NULL);
INSERT INTO `t_dict_code` VALUES (7, 'param_type', 0, '报表', '3', '报表', NULL, 'Y', NULL, '2019-05-16 14:20:40', NULL, '2019-05-16 14:20:40', NULL, 1, NULL);
INSERT INTO `t_dict_code` VALUES (8, 'param_type', 0, '安全', '4', '安全', NULL, 'Y', NULL, '2019-05-16 14:20:40', NULL, '2019-05-16 14:20:40', NULL, 1, NULL);
INSERT INTO `t_dict_code` VALUES (9, 'param_type', 0, '文档', '5', '文档', NULL, 'Y', NULL, '2019-05-16 14:20:40', NULL, '2019-05-16 14:20:40', NULL, 1, NULL);
INSERT INTO `t_dict_code` VALUES (10, 'param_type', 0, '消息', '6', '消息', NULL, 'Y', NULL, '2019-05-16 14:20:40', NULL, '2019-05-16 14:20:40', NULL, 1, NULL);
INSERT INTO `t_dict_code` VALUES (11, 'param_type', 0, '其他', '9', '其他', NULL, 'Y', NULL, '2019-05-16 14:20:40', NULL, '2019-05-16 14:20:40', NULL, 1, NULL);
INSERT INTO `t_dict_code` VALUES (12, 'param_type', 0, '默认', '0', '默认', NULL, 'Y', NULL, '2019-05-16 14:20:40', NULL, '2019-05-16 14:20:40', NULL, 1, NULL);
COMMIT;

-- ----------------------------
-- Table structure for t_sys_notice
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_notice`;
CREATE TABLE `t_sys_notice`
(
    `id`           bigint(20)          unsigned NOT NULL AUTO_INCREMENT COMMENT '公告ID',
    `title`        varchar(64)         NOT NULL COMMENT '公告标题',
    `type`         varchar(8)          NOT NULL DEFAULT 'NOTICE' COMMENT '公告类型（NOTICE-通知， GONGGAO-公告）',
    `content`      text                COMMENT '公告内容',
    `status`       char(1)             DEFAULT '0' COMMENT '公告状态（0正常 1关闭）',
    `created_by`   varchar(64)         DEFAULT null COMMENT '创建者',
    `created_time` datetime            NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `updated_by`   varchar(64)         DEFAULT null COMMENT '更新者',
    `updated_time` datetime            DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
    `remark`       varchar(255)        DEFAULT NULL COMMENT '备注',
    `reversion`    bigint(20)          unsigned DEFAULT 0,
    `rsv1`                 varchar(128),
    KEY `idx_sys_notice_ti` (`title`) USING BTREE,
    PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='通知公告表';

BEGIN;
INSERT INTO `t_sys_notice`
VALUES (1, '新版本内容', 'NOTICE', '温馨提醒：2020-07-01 dryad 新版本发布啦', 0, 'admin', '2020-07-01 11:33:00', 'admin',
        '2020-07-01 11:33:00', '管理员', 1, NULL);
INSERT INTO `t_sys_notice`
VALUES (2, '维护内容', 'NOTICE', '维护通知：2020-12-01 dryad 系统凌晨维护', 0, 'admin', '2020-12-01 11:33:00', 'admin',
        '2020-12-01 11:33:00', '管理员', 1, NULL);
COMMIT;

-- ----------------------------
-- Table structure for t_sys_post
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_post`;
CREATE TABLE `t_sys_post`
(
    `post_id`         bigint(20) unsigned  NOT NULL AUTO_INCREMENT COMMENT '岗位ID',
    `code`       varchar(64) NOT NULL COMMENT '岗位编码',
    `name`       varchar(64) NOT NULL COMMENT '岗位名称',
    `sort`       int(11) unsigned  DEFAULT '1' COMMENT '显示顺序',
    `use_flag`    char(1) default 'Y' comment 'Y正常 N停用',
    `del_flag`   char(1) DEFAULT '0' COMMENT '1:已删除 0:未删除',
    `created_by` varchar(64)          DEFAULT null COMMENT '创建者',
    `created_time` datetime    NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `updated_by` varchar(64)          DEFAULT null COMMENT '更新者',
    `updated_time` datetime default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
    `remark`     varchar(255)         DEFAULT NULL COMMENT '备注',
    `reversion`           bigint(20) unsigned default 0,
    `rsv1`                 varchar(128),
    -- TODO
    -- UNIQUE KEY `idx_sys_post_nm` (`name`) USING BTREE,
    -- TODO
    -- UNIQUE KEY `idx_sys_post_cd` (`code`) USING BTREE,
    PRIMARY KEY (`post_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='岗位信息表';

BEGIN;
INSERT INTO `t_sys_post`
VALUES (1, 'ceo', '董事长', 1, 'Y', '0', 'admin', '2018-03-16 11:33:00', 'admin', '2018-03-16 11:33:00', '', 1, NULL);
INSERT INTO `t_sys_post`
VALUES (2, 'biz', '需求产品', 2, 'Y', '0', 'admin', '2018-03-16 11:33:00', 'admin', '2018-03-16 11:33:00', '', 1, NULL);
INSERT INTO `t_sys_post`
VALUES (3, 'se', '项目经理', 3, 'Y', '0', 'admin', '2018-03-16 11:33:00', 'admin', '2018-03-16 11:33:00', '', 1, NULL);
INSERT INTO `t_sys_post`
VALUES (4, 'dev', '开发工程师', 4, 'Y','0',  'admin', '2018-03-16 11:33:00', 'admin', '2018-03-16 11:33:00', '', 1, NULL);
INSERT INTO `t_sys_post`
VALUES (5, 'test', '测试工程师', 5, 'Y', '0', 'admin', '2018-03-16 11:33:00', 'admin', '2018-03-16 11:33:00', '', 1, NULL);
COMMIT;
-- ----------------------------
-- Table structure for t_sys_user_post
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_user_post`;
CREATE TABLE `t_sys_user_post`
(
    `user_id` bigint(20) unsigned NOT NULL COMMENT '用户ID',
    `post_id` bigint(20) unsigned NOT NULL COMMENT '岗位ID',
    `reversion`           bigint(20) unsigned default 0,
    `rsv1`                 varchar(128),
     KEY `idx_sys_user_post_pi` (`post_id`) USING BTREE,
     PRIMARY KEY (`user_id`, `post_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='用户与岗位关联表';

BEGIN;
INSERT INTO `t_sys_user_post`
VALUES (1, 1, 1, NULL);
INSERT INTO `t_sys_user_post`
VALUES (2, 2, 1, NULL);
INSERT INTO `t_sys_user_post`
VALUES (3, 3, 1, NULL);
COMMIT;

-- ----------------------------
-- Table structure for t_sys_oper_log
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_oper_log`;
CREATE TABLE `t_sys_oper_log`
(
    `id`               bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
    `user_id`          bigint(20) unsigned DEFAULT NULL COMMENT '用户id',
    `user_name`        varchar(64)         DEFAULT NULL COMMENT '用户名',
    `log_type`         varchar(8)          DEFAULT NULL COMMENT '日志类型(LOGIN,LOGOUT,OPER)',
    `description`      varchar(512)        DEFAULT NULL COMMENT '描述',
    `params`           varchar(255)        DEFAULT NULL COMMENT '请求参数',
    `data`             text                COMMENT '请求数据',
    `action_type`      varchar(8)          DEFAULT NULL COMMENT '操作动作类型（其它-OTHER 增-ADD  删-DEL 修改-UPDATE 查-GET）',
    `status`           char(1)             DEFAULT NULL COMMENT '是否成功（0正常 1失败）',
    `class_method`     varchar(255)        DEFAULT NULL COMMENT '类#方法',
    `exception_msg`    text                COMMENT  '异常信息',
    `request_ip`       varchar(64)         DEFAULT NULL COMMENT '请求ip',
    `request_url`      varchar(255)        DEFAULT NULL COMMENT '当前用户请求的url',
    `run_duration`     bigint(20) unsigned DEFAULT NULL COMMENT '请求持续耗时(秒)',
    `http_method`      varchar(8)          DEFAULT NULL COMMENT 'GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS,TRACE',
    `os`               varchar(64)         DEFAULT NULL COMMENT '系统信息',
    `browser`          varchar(64)         DEFAULT NULL COMMENT '浏览器信息',
    `address`          varchar(1024)       DEFAULT NULL COMMENT '地址',
    `created_time`     datetime            NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `updated_time`     datetime            DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
    `reversion`        bigint(20) unsigned DEFAULT 0,
    `rsv1`             varchar(128),
    KEY `idx_sys_oper_log_ui` (`user_id`) USING BTREE,
    KEY `idx_sys_oper_log_un` (`user_name`) USING BTREE,
    PRIMARY KEY (`id`) USING BTREE
)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='系统日志';


/*==============================================================*/
/* Table: shedlock                                              */
/*==============================================================*/
drop table if exists shedlock;
CREATE TABLE shedlock(name VARCHAR(64) NOT NULL, lock_until TIMESTAMP(3) NOT NULL,
    locked_at TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    locked_by VARCHAR(255) NOT NULL,
    PRIMARY KEY (name)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='任务调度配置';

/*==============================================================*/
/* Table: persistent_logins                                   */
/*==============================================================*/
drop table if exists persistent_logins;
CREATE TABLE persistent_logins (
  username varchar(64) not null,
  series varchar(64) not null,
  token varchar(64) not null,
  last_used timestamp not null,
  PRIMARY KEY (series)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='框架依赖登录持久化(暂不用)';


-- ----------------------------
-- Table structure for t_gen_datasource_conf
-- ----------------------------
DROP TABLE IF EXISTS `t_gen_datasource_conf`;
CREATE TABLE `t_gen_datasource_conf` (
   `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
   `name` varchar(64)  CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci not null COMMENT '别名',
   `url` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'jdbcurl',
   `username` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '用户名',
   `password` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '密码',
   `created_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
   `updated_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新',
   `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '1:已删除 0:未删除',
   `tenant_id` varchar(32) DEFAULT NULL COMMENT '租户ID',
   `ds_type` varchar(16) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '数据库类型',
   `conf_type` char(1) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '配置类型（0:主机形式 1:url形式）',
   `ds_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '数据库名称',
   `instance` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '实例',
   `port` SMALLINT unsigned DEFAULT NULL COMMENT '端口',
   `host` varchar(48) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '主机',
   `reversion`           bigint(20) unsigned default 0,
   `rsv1`                 varchar(128),
    -- TODO
    -- UNIQUE KEY `idx_datasource_conf_nm` (`name`) USING BTREE,
   PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='数据源表';
BEGIN;
-- INSERT INTO `t_gen_datasource_conf` (`id`,`name`,`url`,`username`,`password`,`created_time`,`updated_time`,`del_flag`,`tenant_id`,`ds_type`,`conf_type`,`ds_name`,`instance`,`port`,`host`,`reversion`,`rsv1`) VALUES (1,'DB_1','jdbc:mysql://127.0.0.1:3306/dryad_1?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&allowMultiQueries=true&allowPublicKeyRetrieval=true','root','root123','2021-03-10 16:11:08','2021-03-10 16:11:08','0',NULL,'mysql','0','dryad_1',NULL,3306,'127.0.0.1',1, NULL);
-- INSERT INTO `t_gen_datasource_conf` (`id`,`name`,`url`,`username`,`password`,`created_time`,`updated_time`,`del_flag`,`tenant_id`,`ds_type`,`conf_type`,`ds_name`,`instance`,`port`,`host`,`reversion`,`rsv1`) VALUES (2,'DB_2','jdbc:mysql://127.0.0.1:3306/dryad_2?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&allowMultiQueries=true&allowPublicKeyRetrieval=true','root','root123','2021-03-10 16:11:08','2021-03-10 16:11:08','0',NULL,'mysql','0','dryad_2',NULL,3306,'127.0.0.1',1, NULL);
COMMIT;
-- ----------------------------
-- Table structure for t_gen_form_conf
-- ----------------------------
DROP TABLE IF EXISTS `t_gen_form_conf`;
CREATE TABLE `t_gen_form_conf` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `table_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `form_info` json NOT NULL COMMENT '表单信息',
  `created_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '1:已删除 0:未删除',
  `tenant_id` varchar(32) DEFAULT NULL COMMENT '所属租户',
  `reversion`           bigint(20) unsigned default 0,
  `rsv1`                 varchar(128),
  KEY `idx_gen_form_table_name` (`table_name`) USING BTREE,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='表单配置';



SET FOREIGN_KEY_CHECKS = 1;